// 封装banner轮播图相关的业务代码
import { ref, onMounted } from 'vue';
import { getBannerInfo } from '@/apis/home';
export const useBanner = () => {
    const bannerList = ref([]);

    // 获取商品轮播图数据
    const getBannerList = async () => {
        const res = await getBannerInfo({ distributionSite: "2" });
        bannerList.value = res.result;
    };
    
    onMounted(() => {
        getBannerList();
    });
    return {
        bannerList
    }
}